import service from '@/api/request.js'


/**
 * 获取钉钉ticket
 * @returns {*}
 */
export const getTicketApi = ()=>{
  return service({
    url: 'ding/getJsApiTicket',
    method: 'get',
  })
}

/**
 * 获取钉钉签名
 * @returns {*}
 */
export const getSignatureApi = (data)=>{
  return service({
    url: 'ding/signature',
    method: 'post',
    data,
  })
}
/**
 * 通过code获取钉钉userid
 * @returns {*}
 */
export const getDdUserInfoApi = (code)=>{
  return service({
    url: 'ding/getUserInfo',
    method: 'post',
    data:{
      code,
    }
  })
}
/**
 * 通过code获取钉钉userid
 * @returns {*}
 */
export const bindApi = (data)=>{
  return service({
    url: 'ding/user/bind',
    method: 'post',
    data,
  })
}
/**
 * 通过code获取钉钉userid
 * @returns {*}
 */
export const loginApi = (data)=>{
  return service({
    url: 'ding/user/login',
    method: 'post',
    data,
  })
}
/**
 * 通过code获取钉钉userid
 * @returns {*}
 */
export const getRoutersApi = ()=>{
  return service({
    url: 'getRouters',
    method: 'get',
  })
}
/**
 * 获取当前用户信息
 * @returns {*}
 */
export const getCurrentUserApi = ()=>{
  return service({
    url: 'getInfo',
    method: 'get',
  })
}
/**
 *
 * @returns {*}
 */
export const deptTreeApi = ()=>{
  return service({
    url: '/system/user/deptTree',
    method: 'get',
  })
}
